Nicola Rennie
Consultancy
Training
R Community
Choose a font: fonts.google.com
Arial: Does it pass the 1Il test?
Times New Roman: Does it pass the 1Il test?
Courier New: Does it pass the 1Il test?
Colour of geoms (mapped in aes())
Colour of geoms (not mapped in aes())
theme() elements e.g. background colour
Let’s make an example plot to demonstrate…
| name | n |
|---|---|
| Crowned lemur | 2094 |
| Ring-tailed lemur | 7490 |
| Gray mouse lemur | 12275 |
Image: Unsplash
scale_*_brewer(): colorbrewer2.org
Colour palette packages: github.com/EmilHvitfeldt/paletteer
Defining your own colours
{colorblindcheck}
{colorblindr}
name n tolerance ncp ndcp min_dist mean_dist max_dist
1 normal 3 44.33725 3 3 44.337246 48.67622 55.30187
2 deuteranopia 3 44.33725 3 1 25.872723 34.57704 50.79886
3 protanopia 3 44.33725 3 1 9.345734 31.53395 46.54013
4 tritanopia 3 44.33725 3 2 41.560179 50.49023 60.86996
Link: medium.com/nightingale/writing-alt-text-for-data-visualization-2a218ef43f81
The RMarkdown syntax:
{r, fig.alt=ggplot2::get_alt_text(g)}
g2 <- ggplot(data = mtcars,
mapping = aes(x = mpg,
y = disp)) +
geom_point() +
labs(title = "My plot",
subtitle = "A descriptive subtitle.",
alt = "Some of my own alt text.")
generate_alt_text(g2)[1] "My plot. A descriptive subtitle. A plot with mpg on the x-axis and disp on the y-axis. The data is displayed using points. Some of my own alt text."
{ggplot2}
Accessibility
R-Ladies London